from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext

import platform, shutil
if platform.architecture()[0] == "32bit":
    setup(
            cmdclass = {'build_ext': build_ext}, 
            ext_modules = [Extension("ctranslate_by_codon_32",  ["ctranslate_by_codon.pyx"])])
    shutil.copyfile("ctranslate_by_codon_32.so", "../32bit/ctranslate_by_codon.so")
elif platform.architecture()[0] == "64bit":
    setup(
            cmdclass = {'build_ext': build_ext}, 
            ext_modules = [Extension("ctranslate_by_codon_64",  ["ctranslate_by_codon.pyx"])])
    shutil.copyfile("ctranslate_by_codon_64.so", "../64bit/ctranslate_by_codon.so")
else:
    raise Exception("Unknown platform %s: should be 32bit or 64bit" % platform.architecture()[0])
    

